home *** CD-ROM | disk | FTP | other *** search
- ========== Description Part Begin ==========
- Title = staytime
- ProgID = PageletServer.JsBox
- LastUpdateTime = 36418.655057870
- PreviewPath =
- Description = show the time you browse an HTML file
- ========== Description Part End ==========
-
- ========== Parameter Part Begin ==========
- StayTimePara = 6,Center,Text
- JsBoxType = 2
- ========== Parameter Part End ==========
-
- ========== Resource Part Begin ==========
- Resource Number = 0
- ========== Resource Part End ==========
-
- ========== HTML Part Begin ==========
- Segment Number = 1
- Segment Position = cursor
- <form name="srctecstaytime" onSubmit="0">
- <div align="Center">
- <input type="Text" name="time_spent" size="6" onFocus="this.blur()">
- </div>
- </form>
- <script LANGUAGE="JAVASCRIPT">
- var time_start = new Date();
- var clock_start = time_start.getTime();
- function get_time_spent ()
- {
- var time_now = new Date();
- return((time_now.getTime() - clock_start)/1000);
- }
- function show_secs ()
- {
- var i_total_secs = Math.round(get_time_spent());
- var i_secs_spent = i_total_secs % 60;
- var i_mins_spent = Math.round((i_total_secs-30)/60);
- var s_secs_spent = "" + ((i_secs_spent>9) ? i_secs_spent : "0" + i_secs_spent);
- var s_mins_spent = "" + ((i_mins_spent>9) ? i_mins_spent : "0" + i_mins_spent);
- document.srctecstaytime.time_spent.value = s_mins_spent + ":" + s_secs_spent;
- window.setTimeout('show_secs()',1000);
- }
- window.setTimeout('show_secs()',1);
- </script>
- ===== Segment End =====
- ========== HTML Part End ==========
-
-